const Koa = require('koa')
const fs = require('fs')
const jsonp = require('koa-jsonp')
const app = new Koa()
const allConfig = require("./config")
const routers = require('./server/routers/index')

app.use(jsonp())
// 加载路由中间件
app.use(routers.routes()).use(routers.allowedMethods())

app.listen(allConfig.port, () => {
  console.log('[demo] route-use-middleware is starting at port' + allConfig.port)
})